#include "mainwindow.h"
#include "ui_mainwindow.h"

#include "taskTargetTest.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    test = nullptr;
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_opendaphid_clicked()
{

}

void MainWindow::on_start_clicked()
{
    if (test == nullptr)
    {
        test = new taskTargetTest;

        connect(test, SIGNAL(outLog(QString)), this, SLOT(showLog(QString)));

        test->start();
    }
    else
    {
        if (test->isFinished())
            test->start();
    }
}

void MainWindow::showLog(QString msg)
{
    ui->logdis->appendPlainText(msg);
}
